package com.seveneight.baijiesteward.ui.main.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.PayBackRecordBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.main.contract.GetOrderListContract;
import com.seveneight.baijiesteward.ui.main.model.GetOrderListModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/29.
 */

public class GetOrderListPresenter implements GetOrderListContract.GetOrderListPresenter {

    GetOrderListContract.GetorderListView getorderListView;
    GetOrderListContract.GetOrderListModel getOrderListModel;

    public GetOrderListPresenter(GetOrderListContract.GetorderListView getorderListView) {
        this.getorderListView = getorderListView;
        getOrderListModel = new GetOrderListModel();
    }

    @Override
    public void getOrderData(Context context, RequestBody body) {
        getOrderListModel.getOrderData(context,body, new MyCallBack<List<PayBackRecordBean>>() {
            @Override
            public void onSuccess(List<PayBackRecordBean> payBackRecordBean) {
                getorderListView.rebackOrderData(payBackRecordBean);
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
